package com.ym.manager.admin.statics;

import com.ym.utils.StringHandler;

import java.util.List;
import java.util.Map;

/**
 * @Author 但何非
 * @Date 2022/12/13 20:33
 * @ClassName: StaticsVo
 * @Description:
 * @Version:
 */
public class StaticsV2Vo {


    public String beginTime;

    public String endTime;

    public int payNum;

    public String payAmount;

    public int payYhkNum;

    public String payYhkAmount;

    public List<ZfbMoneyInfo> payZfb;
    public int withdrawNum;

    public String withdrawAmount;

    public String freeAmount;

    public List<ZfbMoneyInfo> withdrawZfb;

    public String zfbTotalAmount;

    public int zfbTotalUser;

    public String bankTotalAmount;

    public int bankTotalUser;

    public StaticsV2Vo(){
    }

    public StaticsV2Vo(Map<String,Object> payMap, Map<String,Object> withdrawMap){
        this.payNum = StringHandler.getInt(payMap.get("num"));
        this.payAmount = StringHandler.getString(payMap.get("amount"),0);
        this.withdrawNum = StringHandler.getInt(withdrawMap.get("num")+"");
        this.withdrawAmount = StringHandler.fenToYuan(withdrawMap.get("amount")+"");
        this.freeAmount = StringHandler.fenToYuan(withdrawMap.get("fee")+"");
    }

    public StaticsV2Vo(Map<String, Object> payMap, Map<String, Object> withdrawMap, long zfbTotalAmount, int zfbTotalUser, long bankTotalAmount, int bankTotalUser) {
        if(StringHandler.isNotEmpty(payMap)){
            this.payNum = StringHandler.getInt(payMap.get("num"));
            this.payAmount = StringHandler.getString(payMap.get("amount"),0);
        }
        if(StringHandler.isNotEmpty(withdrawMap)){
            this.withdrawNum = StringHandler.getInt(withdrawMap.get("num")+"");
            this.withdrawAmount = StringHandler.fenToYuan(withdrawMap.get("amount")+"");
            this.freeAmount = StringHandler.fenToYuan(withdrawMap.get("fee")+"");
        }
        this.zfbTotalAmount = StringHandler.fenToYuan(zfbTotalAmount+"");
        this.zfbTotalUser = zfbTotalUser;
        this.bankTotalAmount = StringHandler.fenToYuan(bankTotalAmount+"");
        this.bankTotalUser = bankTotalUser;
    }
}
